package com.yinhe.music.yhmusic.db.bean;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.j256.ormlite.field.DatabaseField;
import com.yinhe.music.yhmusic.model.SongMenuList;

import java.io.Serializable;

/**
 * Created by hasee on 2017/8/31.
 */

public class MenuDBEntity implements MultiItemEntity,Serializable {
    @DatabaseField(columnName = MenuColums.MENU_ID, id = true)
    private int menuId;
    @DatabaseField(columnName = MenuColums.COLLECT)
    private int collect;
    @DatabaseField(columnName = MenuColums.MENU_NAME)
    private String name;
    @DatabaseField(columnName = MenuColums.PLAY)
    private int play;
    @DatabaseField(columnName = MenuColums.IMAGE)
    private String image;
    @DatabaseField(columnName = MenuColums.SONG_SUM)
    private int songnum;
    @DatabaseField(columnName = MenuColums.NICK_NAME)
    private String nickname;
    @DatabaseField(columnName = MenuColums.SONGID)
    private String songIds;
    @DatabaseField(columnName = MenuColums.TYPE)
    private int type;
    @DatabaseField(columnName = MenuColums.LABELS_NAME)
    private String labelsName;
    @DatabaseField(columnName = MenuColums.LABELS_ID)
    private String labelsId;
    @DatabaseField(columnName = MenuColums.EDITABLE)
    private int editable;
    //version 9 add;
    @DatabaseField(columnName = MenuColums.SYS＿MUSIC_LANG)
    private int lang;
    @DatabaseField(columnName = MenuColums.DETAIL)
    private String detail;

    public MenuDBEntity() {
    }

    public MenuDBEntity(int menuId, int collect, String name, int play, String image, int songnum,
                        String nickname, String songIds, int type, int editable, int lang) {
        this.menuId = menuId;
        this.collect = collect;
        this.name = name;
        this.play = play;
        this.image = image;
        this.songnum = songnum;
        this.nickname = nickname;
        this.songIds = songIds;
        this.type = type;
        this.editable = editable;
        this.lang = lang;
    }

    public MenuDBEntity(int menuId, String name,String image ,int songnum) {
        this.menuId = menuId;
        this.name = name;
        this.image = image;
        this.songnum = songnum;
    }

    public MenuDBEntity(int menuId) {
        this.menuId = menuId;
    }

    public MenuDBEntity(SongMenuList songMenu,int type) {
        this.menuId = songMenu.getSongMenuId();
        this.collect = songMenu.getCollectNum();
        this.name = songMenu.getSongMenuName();
        this.play = songMenu.getPlay();
        this.image = songMenu.getImage();
        this.songnum = songMenu.getSongNum();
        this.nickname = songMenu.getNickname();
        this.type = type;
        this.editable = songMenu.getEditable();
        this.lang = songMenu.getNationalType();
    }



    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public int getLang() {
        return lang;
    }

    public void setLang(int lang) {
        this.lang = lang;
    }

    public int getEditable() {
        return editable;
    }

    public void setEditable(int editable) {
        this.editable = editable;
    }

    public String getLabelsName() {
        return labelsName;
    }

    public void setLabelsName(String labelsName) {
        this.labelsName = labelsName;
    }

    public String getLabelsId() {
        return labelsId;
    }

    public void setLabelsId(String labelsId) {
        this.labelsId = labelsId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getSongIds() {
        if (songIds == null){
            return "";
        }
        return songIds;
    }

    public void setSongIds(String songIds) {
        this.songIds = songIds;
    }

    public int getMenuId() {
        return menuId;
    }

    public void setMenuId(int menuId) {
        this.menuId = menuId;
    }

    public int getCollect() {
        return collect;
    }

    public void setCollect(int collect) {
        this.collect = collect;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPlay() {
        return play;
    }

    public void setPlay(int play) {
        this.play = play;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public int getSongnum() {
        return songnum;
    }

    public void setSongnum(int songnum) {
        this.songnum = songnum;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Override
    public int getItemType() {
        return 1;
    }

    public interface MenuColums {
        /* Table name */
        String NAME = "menu_info";
        /* Album IDs column */
        String MENU_ID = "menu_id";
        /* Time played column */
        String MENU_NAME = "menu_name";
        String NICK_NAME = "nick_name";
        String SONG_SUM = "song_sum";
        String COLLECT = "collect";
        String PLAY = "play";
        String IMAGE = "image";
        String SONGID = "song_id";
        String TYPE = "type";
        String LABELS_NAME = "labels_name";
        String LABELS_ID = "labels_id";
        String EDITABLE = "editable";
        int CREATE_MENU = 0;
        int COLLECT_MENU = 1;
        String SYS＿MUSIC_LANG = "lang";
        String DETAIL = "detail";
    }
}
